#include "StringParser.h"

StringParser::StringParser(void)
:token(NULL)
{
}

StringParser::StringParser(const char * expression)
: token(NULL)
{
  SetExpression(expression);
}

StringParser::~StringParser(void)
{
}

void StringParser::SetExpression( const char * expression )
{
  if(expression == NULL)
    return;

  strcpy(m_expression, expression);
  token = strtok(m_expression, " ");
}

bool StringParser::IsFinished()
{
  return token == NULL;
}

void StringParser::ParseNext()
{
  
  if(m_expression == NULL)
    return;
  
  token = strtok(NULL, " ");
}

const char * StringParser::GetToken()
{
  return token;
}